package io.itit.ecp.admin.server.service.impl;

import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
import io.itit.ecp.admin.server.entity.EarlyWarningUserEntity;
import io.itit.ecp.admin.server.mapper.EarlyWarningUserMapper;
import io.itit.ecp.admin.server.service.IEarlyWarningUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 *
 * @Author：Roy
 * @Description：预警推送目标服务实现类
 * @Date：Create by 2023-12-04 16:52:33
 */
@Service
public class EarlyWarningUserServiceImpl extends JoinServiceImpl<EarlyWarningUserMapper, EarlyWarningUserEntity> implements IEarlyWarningUserService {

    @Override
    public List<EarlyWarningUserEntity> findByEarlyWarningId(String earlyWarningId) {
        return StringUtils.isEmpty(earlyWarningId) ? Collections.emptyList() :
                lambdaQuery().eq(EarlyWarningUserEntity::getEarlyWarningId, earlyWarningId)
                        .list();
    }
}